package butines.core.gui;


public class GUIPainel extends GUIComponent { /* implements KeyListener  {

	protected int selectedItem = 0;

	public GUIPainel() {
		
	}

	// implement MouseListener // 
	public void onMouseHover(GUIComponent comp) {
		selectedItem = get.indexOf(comp);
	}
	
	public void onMousePress(GUIComponent comp) {

	}

	// implement KeyListener //
	public void keyPressed(KeyEvent e) {
		int keyCode = e.getKeyCode();
		
		switch (keyCode) {
			
			case KeyEvent.VK_UP: {
				selectedItem--;
				if (selectedItem < 0) {
					selectedItem = getChildren().size() - 1;
				}
				break;
			}
			
			case KeyEvent.VK_DOWN: {
				selectedItem++;
				if (selectedItem > getChildren().size() - 1) {
					selectedItem = 0;
				}
				break;
			}
			
			case KeyEvent.VK_ENTER: {
				GUIComponent comp = getChildren().get(selectedItem);
				comp.postClick();
				e.consume();
				break;
			}
			
		}
		
	}

	@Override
	public void keyTyped(KeyEvent e) {
		
	}

	@Override
	public void keyReleased(KeyEvent e) {
		
	}
	*/
}
